﻿using System.Windows.Shapes;

namespace Gmantis.Controls.Chart
{
    public class LegendItem
    {
        // Fields
        private object _item;
        private string _lbl;
        private Shape _line;
        private Shape _sym;

        // Methods
        internal LegendItem(Shape sym, Shape line, string lbl, object item)
        {
            this._sym = sym;
            this._line = line;
            this._lbl = lbl;
            this._item = item;
        }

        internal void Clear()
        {
            this._item = null;
            this._lbl = null;
            this._line = null;
            this._sym = null;
        }

        public override string ToString()
        {
            if (string.IsNullOrEmpty(this.Label))
            {
                return base.ToString();
            }
            return this.Label;
        }

        // Properties
        public object Item
        {
            get
            {
                return this._item;
            }
        }

        public string Label
        {
            get
            {
                return this._lbl;
            }
        }

        public Shape Line
        {
            get
            {
                return this._line;
            }
        }

        public Shape Symbol
        {
            get
            {
                return this._sym;
            }
        }
    }

    internal class LegendItems : System.Collections.ObjectModel.ObservableCollection<LegendItem>
    {
    }
}
